<template>
    <div class="newsinfo">
        <span @click="back()">返回</span>
        <h2> {{title}}</h2>
        <p v-html="desc"></p>
       
    </div>
</template>

<script>
import axios from 'axios';
import base from '../../assets/js/base.js'
export default {
    data(){
        return{
            id:0,
            title:'',
            desc:''
        }
    },
    created(){
        this.id=this.$route.params.id
         
        this.getnewsinfo()
        console.log(this.id)
    },
    methods:{
       async getnewsinfo(){
             const d = await axios.get(base.webapi+'Article/Getinfo',
            {
                params:{id:this.id}
            })
            this.title=d.data.Data.Title
            this.desc=d.data.Data.Content
            console.log(d.data.Data.Content)
        },
        back(){
            this.$router.back(-1)
        }
    }
    
}
</script>
<style>
.newsinfo{
    padding: 15px
}
</style>
